package xin.mashibo.pattern.visitor;

import xin.mashibo.pattern.composite.FileTreatMentException;

import java.util.Iterator;

/**
 * 目录条目抽象类
 *
 * @author MaShibo
 * 日期 :  2019/1/24
 */
public abstract class Entry implements Element {

    public abstract String getName();

    public abstract int getSize();

    public Entry add(Entry entry) throws FileTreatMentException {
        throw new FileTreatMentException();
    }

    public Iterator<Entry> iterator() throws FileTreatMentException {
        throw new FileTreatMentException();
    }

    @Override
    public String toString() {
        return getName() + " (" + getSize() + ")";
    }

}
